<script type="text/javascript" src="<?php echo Yii::app()->request->baseUrl; ?>/js/jquery.bxslider.min.js"></script>
<script type="text/javascript">
    $(document).ready(function () {
        $('.slider1').bxSlider({
            minSlides:1,
            maxSlides:1,
            auto:true,
            slideMargin:10
        });

        $('.slider2').bxSlider({
            minSlides:1,
            maxSlides:1,
            auto:true,
            slideMargin:10
        });

        $('.slider3').bxSlider({
            minSlides:4,
            maxSlides:4,
            auto:true,
            slideMargin:10
        });
    });
</script>

<!--BODY PANEL START -->
<div class="contener body_panel">
    <div class="left_panel">
        <div class="player_info">
            <img src="<?php echo Yii::app()->request->baseUrl; ?>/images/players/160.160/<?php echo $model->person->image;?>"
                 width="160" height="160" alt="pic" class="alignleft"/>

            <div class="details">
                <h2 class="alignleft"><?php echo $model->person->fullName;?></h2>

                <p class="alignright">Current Status : <span><?php echo $model->person->available;?></span></p>
                <ul class="player_details">
                    <li><strong>Nationality</strong> <span><img width="20" height="14" alt="flag"
                                                                src="<?php echo Yii::app()->request->baseUrl; ?>/images/flags/<?php echo $model->person->citizenship->code;?>.png"/> <?php echo $model->person->citizenship->name;?></span>
                    </li>
                    <li><strong>Age</strong> <span><?php echo $model->person->age;?></span></li>
                    <li><strong>League</strong> <span><?php echo $model->league;?></span></li>
                    <li><strong>Position</strong> <span> <?php echo $model->position;?></span></li>
                </ul>
            </div>
        </div>
        <div class="data alignleft">
            <h2>Technical Data</h2>
            <ul class="player_details">
                <li class="by"><strong>Height</strong> <span> <?php echo $model->height;?></span></li>
                <li class="by"><strong>Weight</strong> <span><?php echo $model->weight;?></span></li>
                <li class="by"><strong>Hand</strong> <span><?php echo $model->hand;?></span></li>
                <li class="by"><strong>Status</strong><span> <?php echo $model->status;?></span></li>
                <li class="by"><strong>National Team</strong><span> <?php echo $model->national;?></span></li>
                <li class="by"><strong>Availability</strong><span> <?php echo $model->person->availability;?></span>
                </li>
            </ul>
        </div>
        <div class="data alignright personal">
            <h2>Personal Data</h2>
            <ul class="player_details">
                <li class="by"><strong>First Name</strong> <span> <?php echo $model->person->firstname;?></span></li>
                <li class="by"><strong>Last Name</strong> <span><?php echo $model->person->lastname;?></span></li>
                <li class="by"><strong>Sex</strong><span> <?php echo $model->person->sex;?></span></li>
                <li class="by"><strong>Mother tongue</strong><span> <?php echo $model->person->mother_language;?></span>
                </li>
                <li class="by"><strong>Other
                    languages</strong><span> <?php echo $model->person->other_languages;?></span></li>
                <li class="by"><strong>Current residence</strong><span> <img width="20" height="14" alt="flag"
                                                                             src="<?php echo Yii::app()->request->baseUrl; ?>/images/flags/<?php echo $model->person->residence->code;?>.png"/> <?php echo $model->person->residence->name;?></span>
                </li>
            </ul>
        </div>
        <div class="previous">
            <h2>Previous Team</h2>

            <div class="previous_team_info">
                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tr class="heading">
                        <td width="151" height="37" align="left" valign="middle"><strong>Team</strong></td>
                        <td width="293" height="37" align="left" valign="middle">Country</td>
                        <td width="187" height="37" align="left" valign="middle">Start</td>
                        <td height="37" align="left" valign="middle" class="last">End</td>
                    </tr>
                    <?php foreach ($model->teams as $item): ?>
                        <?php if($item->current != 1): ?>
                            <tr>
                                <td width="151" height="37" align="left" valign="middle">
                                    <strong><?php echo $item->name;?></strong></td>
                                <td width="293" height="37" align="left" valign="middle">
                                    <img src="<?php echo Yii::app()->request->baseUrl; ?>/images/flags/<?php echo $item->country->code;?>.png"
                                         width="20" height="14" alt="flag"
                                         class="alignleft"/> <?php echo$item->country->name;?>
                                </td>
                                <td width="187" height="37" align="left"
                                    valign="middle"><?php echo Yii::app()->dateFormatter->formatDateTime($item->start, 'long', null);?></td>
                                <td height="37" align="left" valign="middle"
                                    class="last"><?php echo Yii::app()->dateFormatter->formatDateTime($item->end, 'long', null);?></td>
                            </tr>
                        <?php endif;?>
                    <?php endforeach; ?>
                </table>
                <div class="info">
                    <p><strong>Career Achievements</strong></p>

                    <p><?php echo $model->achievements; ?></p>
                </div>
                <div class="info nodevider">
                    <h2>Player's Private Section</h2>

                    <h3>Contact Information</h3>

                    <?php if (Yii::app()->user->getIsGuest()): ?>
                    <p>This is a reserved area only for managers. If you are a manager you can access, inserting your
                        credentials.</p>
                    <form id="details-login" action="<?php echo Yii::app()->request->baseUrl; ?>/index.php?r=auth/login"
                          method="post">
                        <input type="hidden" name="_ajax" value="true"/>
                        <input type="text" class="textbox" name="email" placeholder="User name"/>
                        <input type="password" class="textbox" name="password" placeholder="Password"/>
                        <input type="image" src="<?php echo Yii::app()->request->baseUrl; ?>/images/submit.jpg"/>
                    </form>
                    <?php endif;?>
                    <?php if (!Yii::app()->user->getIsGuest() && Yii::app()->session['_logged_email'] == $model->person->email): ?>
                    <ul class="private_details">
                        <li><strong>Phone</strong> <span> <?php echo $model->person->phone;?></span></li>
                        <li class="by"><strong>Email</strong> <span><?php echo $model->person->email;?></span></li>
                        <li class="by"><strong>Video Link</strong> <span><?php echo $model->person->video;?></span></li>
                    </ul>
                    <?php endif;?>
                </div>
            </div>
        </div>
    </div>
    <h2>Players in the same position</h2>

    <div class="scroller_panel slider3">
        <?php foreach ($samePlayers as $player): ?>
        <div class="players_panel">
            <div class="info">
                <img class="player" alt="pic"
                     src="<?php echo Yii::app()->request->baseUrl; ?>/images/players/160.160/<?php echo $player->person->image;?>"/>

                <div class="details">
                    <h3><?php echo $player->person->fullName;?></h3>
                    <ul>
                        <li><strong>Citizenship</strong> <span><img width="20" height="14" alt="flag"
                                                                    src="<?php echo Yii::app()->request->baseUrl; ?>/images/flags/<?php echo $player->person->citizenship->code;?>.png"/> <?php echo $player->person->citizenship->name;?></span>
                        </li>
                        <li><strong>Position</strong> <span><?php echo $player->position;?></span></li>
                        <li><strong>Hand</strong> <span><?php echo $player->hand;?></span></li>
                        <li><strong>Current residence</strong> <span><img width="20" height="14" alt="flag"
                                                                          src="<?php echo Yii::app()->request->baseUrl; ?>/images/flags/<?php echo $player->person->residence->code;?>.png"/> <?php echo $player->person->residence->name;?></span>
                        </li>
                    </ul>
                </div>
            </div>
            <img width="385" height="16" alt="pic"
                 src="<?php echo Yii::app()->request->baseUrl; ?>/images/players-info-bg-big.jpg"/>
        </div>
        <?php endforeach; ?>
    </div>
</div>